#ifndef __QE_EARLYCON_H__
#define __QE_EARLYCON_H__ 



#define QE_EARLYCON_START(_name)\
    qe_used const qe_earlycon_entry \
    qe_earlycon_##_name qe_section(".qe_earlycon.0")

#define QE_EARLYCON_END(_name)\
    qe_used const qe_earlycon_entry \
    qe_earlycon_##_name qe_section(".qe_earlycon.2.end")

#define QE_EARLYCON(_name) \
    qe_used const qe_earlycon_entry \
    qe_earlycon_##_name qe_section(".qe_earlycon.1")

#define QE_EARLYCON_FORCE_EXPORT(_name) \
    void _name##_earlycon_force_include(void) { \
        (void)&qe_earlycon_##_name; \
    };

#define QE_EARLYCON_FORCE_IMPORT(_name) \
    extern void _name##_earlycon_force_include(void); \
    _name##_earlycon_force_include();

typedef struct
{
    qe_const_str compatible;
    void (*init)(const void *fdt, int offset);
    void (*putc)(qe_ubase iobase, char c);
} qe_earlycon_entry;

void qe_earlycon_init(const void *fdt);

void qe_earlycon_putc(char c);



#endif /* __QE_EARLYCON_H__ */